package socket.udp;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author 周宇
 * @create 2020-05-25 13:53
 * 网络编程
 */
public class InetaddressDemo1 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress address = InetAddress.getByName("ZhouYu");

        System.out.println("主机名：" + address.getHostName());
        System.out.println("IP：" + address.getHostAddress());
    }
}
